import Vue from 'vue'
import Router from 'vue-router'

import {
  Traffic,
  TrafficLineNetWork,
  TrafficCongestion,
  TrafficUserFlow,
  TrafficRunningBus,
  TrafficBusPosition,
  Mobile
} from '../views/index.js'

Vue.use(Router)

const TrafficChildren = [ // 公交大屏地图类型路由
  { path: '/TrafficLineNetWork', component: TrafficLineNetWork },
  { path: '/TrafficCongestion', component: TrafficCongestion },
  { path: '/TrafficUserFlow', component: TrafficUserFlow },
  { path: '/TrafficRunningBus', component: TrafficRunningBus },
  { path: '/TrafficBusPosition', component: TrafficBusPosition }
]

// const MobileChildren = [ // 移动端大屏地图类型路由
//   { path: '/MobileLineNetWork', component: MobileLineNetWork },
//   { path: '/MobileCongestion', component: MobileCongestion }
// ]

export function createRouter () {
  return new Router({
    routes: [
      { path: '/', redirect: '/TrafficLineNetWork'},
      { path: '/Traffic', component: Traffic, children: TrafficChildren},
      { path: '/Mobile', component: Mobile }
    ]
  })
}
